import mockjs from 'mockjs'
const openError = false
const errorTemp = {
  code: 0,
  message: '请求错误，请稍后在试',
  data: '',
}

const bannerListTemp = {
  code: 200,
  message: 'success',
  'data|3': [
    {
      'id|+1': 1,
      title: '@ctitle(5, 10)',
      description: '@csentence(20, 30)',
      image: '@image("300x200", "#50B347", "#FFF", "Mock Banner")',
      link: '@url',
      createTime: '@datetime',
    },
  ],
}
mockjs.setup({
  timeout: '1000-3000',
})
export default {
  bannerList: mockjs.mock(
    '/banner/getList',
    openError ? errorTemp : bannerListTemp
  ),
}
